﻿using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Sol_NetCoreDemo.Controllers.DI
{
    public static class WorkExtension2
    {
        /// <summary>
        /// AddRedisService
        /// </summary>
        /// <param name="service"></param>
        /// <param name="val"></param>
        /// <returns></returns>
        public static IServiceCollection AddWorkService(this IServiceCollection service, string val)
        {

            //return service.AddSingleton(factory => new Work2(val));
            return service.AddSingleton(new Work2(val));
        }
    }
}
